<?php
    // Send Header
    $xls->setHeader('Reporte_'.date('Y_m_d').'.xls');

    // XLS Data Cell
    $xls->BOF();
    $xls->writeLabel(1,0,"VENETEL");
    $xls->writeLabel(2,0,"Reporte de Servicios por Ordenes : ");

    $xls->writeLabel(4,0,"Orden");
    $xls->writeLabel(4,1,"Servicio");
    $xls->writeLabel(4,2,"Posicion");
    $xls->writeLabel(4,3,"Cantidad");

	$x = 5;
	$y = 0;

	foreach ($servordenes as $servordene){
    $xls->writeLabel($x, $y++, $servordene['Ordene']['nu_orden'], array('controller' => 'ordenes', 'action' => 'view', $servordene['Ordene']['id']));
    $xls->writeLabel($x, $y++, $servordene['Servicio']['nm_servicio'], array('controller' => 'servicios', 'action' => 'view', $servordene['Servicio']['id']));
    $xls->writeLabel($x, $y++, $servordene['Servordene']['posicion']);
    $xls->writeLabel($x, $y++, $servordene['Servordene']['cantidad']);
	$x++;
		if($y === 4) {
			$y = 0;
		}
	}

    $xls->EOF();
    exit();
?>